#!/usr/bin/env python3
# -*- coding: utf-8 -*-

__autho__ = "Tony.Don"
__lastupdatetime__ = "2017/09/20"

from core.analysis import analysis
from core.event import eventmanager

class analysisHtml(analysis):
    findtag = None
    findattr = None
    def __init__(self):pass

    def findbyElement(self,tag):
        self.findtag = tag
    
    def getAttr(self,attr):
        self.findattr = attr

    def s_tag(self,tag,attrs):
        self.m_element.setStag(tag,attrs)

    def e_tag(self,tag):
        self.m_element.setEtag(tag)
        self.triggerevent(self.__event__.e_tag)(self.m_element)

    def data(self,data):
        self.m_element.setData(data)

    def comment(self,comment):
        self.m_element.setComment(comment)

    def entityref(self,entityref):
        self.m_element.setEntityref(entityref)

    def charref(self,charref):
        self.m_element.setCharref(charref)

    def decl(self,decl):
        self.m_element.setCharref(decl)